1. Technical Field
Embodiments of the inventive subject matter generally relate to the field of computers, and more particularly, to runtime checking of dynamic sub-ranges.
2. Background
Software can suffer from the effects of integer variables assuming values outside their specified range. This often leads to data corruption resulting from a variety of errors including stack overflow, array access out of bounds, etc. Programmers use programming practices, which include the use of assertions and sub range data types, to combat these errors. However, these programming practices often lead to an increase in conditional statements, which in turn decreases processor performance. To avoid the decrease in processor performance, programmers disable range checking in performance-critical code.